﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Volunteering.ascx.cs" Inherits="Pantry.Web.Users.Controls.Volunteering" %>
<%@ Register TagPrefix="cc1" Namespace="SiteUtils" Assembly="CollectionPager" %>
<asp:UpdatePanel runat="server" ID="UpdatePanelVolunteering">
    <Triggers>
        <asp:AsyncPostBackTrigger ControlID="CollectionPager" EventName="Click" />
        <asp:AsyncPostBackTrigger ControlID="LinkGroupAll" EventName="Click" />
        <asp:AsyncPostBackTrigger ControlID="LinkGroup0" EventName="Click" />
        <asp:AsyncPostBackTrigger ControlID="LinkGroup1" EventName="Click" />
        <asp:AsyncPostBackTrigger ControlID="LinkGroup2" EventName="Click" />
        <asp:AsyncPostBackTrigger ControlID="LinkGroup3" EventName="Click" />
        <asp:AsyncPostBackTrigger ControlID="LinkGroup4" EventName="Click" />
        <asp:AsyncPostBackTrigger ControlID="LinkGroup5" EventName="Click" />
        <asp:AsyncPostBackTrigger ControlID="LinkGroup6" EventName="Click" />
        <asp:AsyncPostBackTrigger ControlID="SortByContact" EventName="Click" />
        <asp:AsyncPostBackTrigger ControlID="SortByPorpose" EventName="Click" />
        <asp:AsyncPostBackTrigger ControlID="SortNumberType" EventName="Click" />
        <asp:AsyncPostBackTrigger ControlID="SortByStartDate" EventName="Click" />
        <asp:AsyncPostBackTrigger ControlID="SortByEndDate" EventName="Click" />
        <asp:AsyncPostBackTrigger ControlID="SortByActivated" EventName="Click" />
        <asp:AsyncPostBackTrigger ControlID="CheckBoxIncludeActivate" EventName="CheckedChanged" />
        <asp:AsyncPostBackTrigger ControlID="RepeaterListVoluteers" EventName="ItemCommand" />
    </Triggers>
    <ContentTemplate>
        <div class="dtBottom">
            <div class="dtPagination more" style="float:left;margin-left:-15px;">
                <div class="dataTables_paginate paging_full_numbers" id="DataTables_Table_0_paginate">
                    <span><asp:LinkButton ID="LinkGroupAll" Text="All" runat="server" OnClick="LinkGroupAllClick" /></span>
                    <span><asp:LinkButton ID="LinkGroup0" Text="0-9" runat="server" OnClick="LinkGroup0Click" /></span> 
                    <span><asp:LinkButton ID="LinkGroup1" Text="A B C D E" runat="server" OnClick="LinkGroup1Click" /></span> 
                    <span><asp:LinkButton ID="LinkGroup2" Text="F G H I J" runat="server" OnClick="LinkGroup2Click" /></span> 
                    <span><asp:LinkButton ID="LinkGroup3" Text="K L M N" runat="server"  OnClick="LinkGroup3Click" /></span> 
                    <span><asp:LinkButton ID="LinkGroup4" Text="O P Q R" runat="server"  OnClick="LinkGroup4Click" /></span> 
                    <span><asp:LinkButton ID="LinkGroup5" Text="S T U V" runat="server" OnClick="LinkGroup5Click" /></span> 
                    <span><asp:LinkButton ID="LinkGroup6" Text="W X Y Z" runat="server"  OnClick="LinkGroup6Click" /></span> 
                </div>
            </div>
            <div class="active-panel">
                <asp:CheckBox ID="CheckBoxIncludeActivate" runat="server" CssClass="simple_form abc" AutoPostBack="True" Checked="true"/>
                <asp:Label ID="Label1" runat="server" for="CheckBoxIncludeActivate" Text="Include in-active" />
            </div>
            <asp:Button ID="ButtonCreate" Text="Create" runat="server" CssClass="buttonCreateDepartment MarginButton" OnClick="ButtonCreateClick" />
        </div>
        <div style="clear: both;"></div>
        <div class="widget_contents noPadding">
                    <table class="tables">
                        <thead>
                            <tr>
                                <th></th>
                                <th class="sorting" style="width:150px;">
                                    <asp:LinkButton ID="SortByContact" runat="server" Text="Contact" OnClick="SortByContactClick" />
                                </th>
                                <th class="sorting" style="width:180px;">
                                    <asp:LinkButton ID="SortByPorpose" runat="server" Text="Porpose" OnClick="SortPurposeClick" />
                                </th>
                                <th class="sorting" style="width:80px;">
                                    <asp:LinkButton ID="SortNumberType" runat="server" Text="Number" OnClick="SortNumberTypeClick" />
                                </th>
                                <th class="sorting" style="width:180px;">
                                    <asp:LinkButton ID="SortByStartDate" runat="server" Text="Start Date" OnClick="SortByStartDateClick" />
                                </th>
                                <th class="sorting" style="width:180px;">
                                    <asp:LinkButton ID="SortByEndDate" runat="server" Text="End Date" OnClick="SortByEndDateClick" />
                                </th>
                                <th class="sorting">
                                    <asp:LinkButton ID="SortByActivated" runat="server" Text="Is Active" OnClick="SortByActivatedClick"  />
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                            <asp:Repeater ID="RepeaterListVoluteers" runat="server" OnItemCommand="MarkActivated">
                                <ItemTemplate>
                                    <tr>
                                        <td>
                                            <asp:HiddenField ID="HiddenFeildContactId" runat="server" Value='<%# String.Format("{0}",Eval("ID")) %>' />
                                            <asp:LinkButton ID="LinkButton1" runat="server" Visible='<%#Eval("IsActive").Equals("Yes")? true : false %>'><%#Eval("ContactName")%></asp:LinkButton>
                                            <asp:LinkButton ID="LinkButton2" runat="server" Visible='<%#Eval("IsActive").Equals("No")? true : false %>' OnClientClick="return confirm('Do you want to make this Service active?');" CommandName="update"><%#Eval("ContactName")%></asp:LinkButton>
                                        </td>
                                        <td>
                                            <%# Eval("VolunteerPurpose")%>
                                        </td>
                                        <td>
                                            <%# Eval("VolunteerNo")%>
                                        </td>
                                        <td>
                                            <%# Eval("StartDate")%>
                                        </td>
                                        <td>
                                            <%# Eval("EndDate")%>
                                        </td>
                                        <td>
                                            <%# Eval("IsActive")%>
                                        </td>
                                    </tr>
                                </ItemTemplate>
                            </asp:Repeater>
                        </tbody>
                    </table>
                    <div class="dtBottom">
                        <div class="dtPagination">
                            <cc1:CollectionPager ID="CollectionPager" runat="server" HideOnSinglePage="false"
                                BackText="Back" FirstText="First" ShowLabel="False" ShowFirstLast="False" NextText="Next"
                                ResultsLocation="None" PageNumbersSeparator=" " PagingMode="PostBack">
                            </cc1:CollectionPager>
                        </div>
                    </div>
                </div>
    </ContentTemplate>
</asp:UpdatePanel>